package thread;
//is开头的方法一般返回值都是boolean类型
public class ThreadInfoDemo {
    public static void main(String[] args) {
        String a;
        Thread t = Thread.currentThread();

        System.out.println("name:"+t.getName());
        System.out.println("id:"+t.getId());
        System.out.println("优先级"+t.getPriority());
        if (t.isAlive()){
            a = "是";
        }else {
            a = "否";
        }
        System.out.println("是否活着:"+a);
        if (t.isDaemon()){
            a = "是";
        }else {
            a = "否";
        }
        System.out.println("是否为守护线程:"+a);
        if (t.isInterrupted()){
            a = "是";
        }else {
            a = "否";
        }
        System.out.println("是否被中断:"+a);

    }
}
